#ifndef FILEHTMLDATA_H
#define FILEHTMLDATA_H

#include <QString>
#include <QVector>


class FileHTMLData
{
public:

    explicit FileHTMLData() : _size(0) {}

    FileHTMLData(const QString & s, double sz, bool isdir, const QString & r);
    FileHTMLData(const FileHTMLData & d);
    FileHTMLData(const FileHTMLData *d);

    FileHTMLData & operator = ( const FileHTMLData *);
    FileHTMLData & operator = ( const FileHTMLData &);
    bool operator >( const FileHTMLData * );
    bool operator >( const FileHTMLData & );
    int compare( const FileHTMLData * );
    int compare( const FileHTMLData & );


    inline QString name() const {
        return _name;
    }

    inline QString range() const {
        return _range;
    }

    inline double size() const {
        return _size;
    }

    inline double isDir() const {
        return is_dir;
    }

private:
    QString _name;
    double _size;
    QString _range;
    bool is_dir;
};



class FileHTMLDataList
{
private:
    QVector <FileHTMLData> _files;
    QVector <FileHTMLData> _dirs;

public:

    FileHTMLDataList();

    FileHTMLData * dirs_at(int );
    FileHTMLData * files_at(int );

    FileHTMLDataList & append( const FileHTMLData &);
    FileHTMLDataList & append( const FileHTMLData *);

    FileHTMLDataList & operator <<( const FileHTMLData *);
    FileHTMLDataList & operator <<( const FileHTMLData &);

    FileHTMLDataList & sort();

    bool isEmpty();
    size_t dirs_size();
    size_t files_size();
    size_t size();

private:
    void insert_sort(QVector <FileHTMLData> & d);

};



#endif // FILEHTMLDATA_H
